package com.axin.blog.api;


import com.axin.blog.api.domain.BlogComment;
import com.axin.blog.api.vo.BlogCommentVo;
import com.axin.common.core.constant.ServiceNameConstants;
import com.axin.common.core.domain.web.AjaxResult;
import com.axin.common.core.domain.web.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 博客服务 远程调用
 *
 * @Author axin
 * @Date 2021/10/31 23:15
 */
@FeignClient(contextId = "remoteCommentService", value = ServiceNameConstants.BLOG_SERVICE, path = "/comment")
public interface RemoteCommentService {

    /**
     * 查询评论列表
     *
     * @param pageNum
     * @param pageSize
     * @param blogId
     * @return
     */
    @GetMapping("/getCommentList")
    TableDataInfo<BlogCommentVo> getCommentList(@RequestParam("pageNum") Integer pageNum,
                                                @RequestParam("pageSize") Integer pageSize,
                                                @RequestParam("blogId") Long blogId);


    /**
     * 评论
     * @param comment
     * @return
     */
    @PostMapping("/comment")
    AjaxResult comment(@RequestBody BlogComment comment);


}
